Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Ledger cleanup fix #9131

Merged
merged 1 commit into from
Mar 31, 2020
Merged

Ledger cleanup fix #9131

merged 1 commit into from
Mar 31, 2020

Conversation

sakridge
Copy link
Contributor

Problem

Ledger purge logic is broken, it makes the assumption that the node starts from slot 0, which is almost never the case. It also works on slots which is not an accurate measure of the space taken by the ledger since a slot can have a variable amount of data. The first assumption means that when --no-rocksdb-compaction option is enabled, a purge is running every slot for at least the first 300,000 slots causing really poor insertion performance.

Summary of Changes

Convert to checking if the number slots is greater than some interval before doing the purge. Also, switch the unit of measure to shred.
Fixes the problems with high insertion time seen with #9009 when --no-rocksdb-compaction option is enabled.

Fixes #

@sakridge sakridge requested a review from carllin March 27, 2020 19:07
@sakridge sakridge changed the title Ledger cleanup updates Ledger cleanup fix Mar 27, 2020
@sakridge sakridge force-pushed the fix-ledger-purge branch 2 times, most recently from 47b94c8 to becb91f Compare March 27, 2020 19:52
@codecov
Copy link

codecov bot commented Mar 27, 2020

Codecov Report

Merging #9131 into master will increase coverage by 0.0%.
The diff coverage is 95.3%.

@@          Coverage Diff           @@
##           master   #9131   +/-   ##
======================================
  Coverage    81.0%   81.0%           
======================================
  Files         276     276           
  Lines       60588   60678   +90     
======================================
+ Hits        49078   49171   +93     
+ Misses      11510   11507    -3     

@mvines mvines added v1.1 and removed v1.0 labels Mar 28, 2020
@sakridge
Copy link
Contributor Author

@carllin mind taking a look when you get a chance?

@mvines mvines added the v1.0 label Mar 29, 2020
@sakridge sakridge force-pushed the fix-ledger-purge branch 5 times, most recently from 87a1bbf to e21da9f Compare March 31, 2020 00:01
* Fix purging happening every slot when cleanup service is not started at slot 0
* Purge by shred count instead of slots since slots can have variable
number of shreds
@sakridge sakridge merged commit 73e99cc into solana-labs:master Mar 31, 2020
@sakridge sakridge deleted the fix-ledger-purge branch March 31, 2020 02:02
mergify bot pushed a commit that referenced this pull request Mar 31, 2020
* Fix purging happening every slot when cleanup service is not started at slot 0
* Purge by shred count instead of slots since slots can have variable
number of shreds

(cherry picked from commit 73e99cc)
@mergify mergify bot mentioned this pull request Mar 31, 2020
mergify bot pushed a commit that referenced this pull request Mar 31, 2020
* Fix purging happening every slot when cleanup service is not started at slot 0
* Purge by shred count instead of slots since slots can have variable
number of shreds

(cherry picked from commit 73e99cc)
@mergify mergify bot mentioned this pull request Mar 31, 2020
solana-grimes pushed a commit that referenced this pull request Mar 31, 2020
solana-grimes pushed a commit that referenced this pull request Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants